<!DOCTYPE html>
<html>
<head>
    <title>模板管理</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <select class="form-control" v-model="q.inOut">
                    <option v-for="io in this.inOuts" :value="io.value">{{io.msg}}</option>
                </select>

            </div>
            <div class="form-group col-sm-2">
                <select class="form-control" v-model="q.deptId">
                    <option v-for="dept in this.depts" :value="dept.deptId">{{dept.name}}</option>
                </select>
            </div>
            <div class="form-group col-sm-2">
                <select class="form-control" v-model="q.type">
                    <option v-for="type in this.types" :value="type.value">{{type.msg}}</option>
                </select>
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <a class="btn btn-default" @click="add">添加</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>
    <div v-show="showAdd" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal addTemplate" enctype="multipart/form-data">
            <div class="form-group">
                <div class="col-sm-2 control-label">选择类型</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="template.type">
                        <option v-for="type in this.types" :value="type.value">{{type.msg}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">导入导出</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="template.inOut">
                        <option v-for="io in this.inOuts" :value="io.value">{{io.msg}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">渠道</div>
                <div class="col-sm-10">
                    <select class="form-control" v-model="template.deptId">
                        <option v-for="dept in this.depts" :value="dept.deptId">{{dept.name}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">模板文件</div>
                <div class="col-sm-10">
                    <input type="file" class="form-control" name="file" id="uploadFile"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">文件描述</div>
                <div class="col-sm-10">
                    <textarea cols="40" rows="5" v-model="template.remark">

                    </textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary " @click="save" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/template.js?_${.now?long}"></script>
</body>
</html>